﻿
// CGWORK19190111View.h: CCGWORK19190111View 类的接口
//
#include"DrawMode.h"
#include"DrawCube.h"
#pragma once


class CCGWORK19190111View : public CView
{
protected: // 仅从序列化创建
	CCGWORK19190111View() noexcept;
	DECLARE_DYNCREATE(CCGWORK19190111View)

// 特性
public:
	CCGWORK19190111Doc* GetDocument() const;
	int r, g, b;
// 操作
public:

// 重写
public:
	virtual void OnDraw(CDC* pDC);  // 重写以绘制该视图
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);

// 实现
public:
	virtual ~CCGWORK19190111View();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// 生成的消息映射函数
protected:
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnDrawSetcolor();
	afx_msg void OnLine();
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	COLORREF currColor();
	DrawMode* currMode;
	int lastx;
	int lasty;
	int haslast;
	void setLastPoint(int x, int y)
	{
		lastx = x;
		lasty = y;
	}

	void decreasePointCnt(int dec)
	{
		haslast -= dec;
	}

	bool hasLastPoint()
	{
		return haslast>0;
	}
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	int dragX;
	int dragY;
	afx_msg void OnDraw2dDrawcircle();
	afx_msg void OnDraw2dDrawline();
	afx_msg void OnDraw2dDrawsquare();
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnDraw2dDrawpoly();
	void resetPointCnt();
	afx_msg void OnDraw2dDrawbezier();
	afx_msg void OnDrawSetfillcolor();
//	COLORREF fillColor;
	int fill_r;
	int fill_g;
	int fill_b;

	COLORREF fillColor()
	{
		// TODO: 在此处添加实现代码.
		return RGB(fill_r, fill_g, fill_b);
	}
	afx_msg void OnDrawcube();
	DrawCube::XYZ center;
	int move_step;
	int rotate_angle;
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnMovex();
	afx_msg void OnMovey();
	afx_msg void OnMoveZ();
	afx_msg void OnMoveY();
	afx_msg void OnMoveX();
	afx_msg void OnRotateX();
	afx_msg void OnRotateZ();
	afx_msg void OnRotateY();
	afx_msg void OnSetsteps();
	afx_msg void OnClearwindow();
};

#ifndef _DEBUG  // CGWORK19190111View.cpp 中的调试版本
inline CCGWORK19190111Doc* CCGWORK19190111View::GetDocument() const
   { return reinterpret_cast<CCGWORK19190111Doc*>(m_pDocument); }
#endif

